from sqlalchemy import Column, ForeignKey
from sqlalchemy.types import Integer
from sqlalchemy.orm import relationship
from __init__ import Base

class CommentGrid(Base):

    __tablename__ = "commentgrid"

    commentid = Column(Integer, ForeignKey('comments.id'), primary_key=True)
    gridid = Column(Integer, ForeignKey('grids.id'), primary_key=True)

    grids = relationship("Grids")

    def __init__(self, commentid, gridid):
        self.commentid = commentid
        self.gridid = gridid

    def __repr__(self):
        return "<CommentGrid('%s', '%s')>" % (self.commentid, self.gridid)
